package demo1;

public class Pet {
    public String name;
    public int age;
    public  int love;

    public Pet(String name, int age, int love) {
        this.name = name;
        this.age = age;
        this.love = love;
    }

    @Override
    public String toString() {
        return "Pet{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", love=" + love +
                '}';
    }

    public void print(){
        System.out.println("这是一个宠物");
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public int getLove() {
        return love;
    }

}
